]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dnd: Drop captured event handler
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 2 Feb 2022 16:07:42 +0000 (17:07 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 2 Feb 2022 16:22:20 +0000 (17:22 +0100)
This was here exclusively to silence out events from other pointing
devices in the stage. Since ClutterGrab being used now is global to
all devices and events are coerced to an invisible actor, there is
no need to explicitly do this.

Also, this event handler was set on the stage, while the grab happened
on a child, so it was fairly uneffective already.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2146>

js/ui/dnd.js

index 9fbdf287383ccda21b3fae926d7c7f331e8bf2cf..f5f3bb40b44d3d3cfa1eb22d38185de5122a76bf 100644 (file)
@@ -116,8 +116,6 @@ var _Draggable = class _Draggable {
         this._buttonDown = false; // The mouse button has been pressed and has not yet been released.
         this._animationInProgress = false; // The drag is over and the item is in the process of animating to its original position (snapping back or reverting).
         this._dragCancellable = true;
-
-        this._capturedEventId = 0;
     }
 
     _onButtonPress(actor, event) {
@@ -167,22 +165,9 @@ var _Draggable = class _Draggable {
         this._grab = global.stage.grab(actor);
         this._grabbedDevice = pointer;
         this._touchSequence = touchSequence;
-
-        this._capturedEventId = global.stage.connect('captured-event', (o, event) => {
-            let device = event.get_device();
-            if (device != this._grabbedDevice &&
-                device.get_device_type() != Clutter.InputDeviceType.KEYBOARD_DEVICE)
-                return Clutter.EVENT_STOP;
-            return Clutter.EVENT_PROPAGATE;
-        });
     }
 
     _ungrabDevice() {
-        if (this._capturedEventId != 0) {
-            global.stage.disconnect(this._capturedEventId);
-            this._capturedEventId = 0;
-        }
-
         if (this._grab) {
             this._grab.dismiss();
             this._grab = null;